Page({
  data:{
    account_id:'',
    account_photo:'',
    account_name:'',
    account_dept:'',
    account_sexNumber:'',
    account_sex:'',
    account_birthday:'',
    account_phone:'',
    account_email:'',
  },
  onClickLeft() {
    wx.showToast({ title: '点击返回', icon: 'none' });
    wx.switchTab({
      url: '/pages/info/info' // 跳转到个人信息页面
    });
  },
  onLoad(options) {
    const that=this;
    that.setData({
      account_id:options.account_id,
    })
    console.log(that.data.account_id);
    wx.request({
      url: 'http://localhost:8080/employee/information/'+that.data.account_id,
      method:'GET',
      success(res){
        that.setData({
          account_name:res.data.name,
          account_photo:res.data.photo,
          account_dept:res.data.deptName,
          account_sexNumber:res.data.sex,
          account_birthday:res.data.birthday,
          account_phone:res.data.phone,
          account_email:res.data.email,
        })
        if(that.data.account_sexNumber==='0'){
          that.setData({
            account_sex:'男'
          })
        }else{
          that.setData({
            account_sex:'女'
          })
        }
      }
    })

  },
  onClickRight() {
    wx.showToast({ title: '点击按钮', icon: 'none' });
  }
});
